<template>
    <div>
        <div class="weui-panel weui-panel_access">
            <div class="weui-panel__bd">
                <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg" v-for="item in comments.data">
                    <div class="weui-media-box__hd">
                        <img class="weui-media-box__thumb" :src="item.img" alt="">
                    </div>
                    <div class="weui-media-box__bd">
                        <h4 class="weui-media-box__title">{{item.name}}</h4>
                        <p class="weui-media-box__desc">{{item.desc}}</p>
                    </div>
                </a>
              
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
           return {
               comments: {}
           }
        },
        created(){
            this.getData('/comments', {id: this.$route.id});
        },
        methods: {
            getData(url, params){
                this.$http({url: url, params: params}).then(res=>this.comments = JSON.parse(res.data));
            }
        }
    }
</script>
<style lang="sass"></style>